<%@ tag description="Allows to add a new comment or response" pageEncoding="UTF-8" %>
<%@ taglib prefix="iwebmvc" uri="http://tags.iwebmvc.com" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %>
<%@ attribute name="issueClass" type="java.lang.Class" required="true" %>
<%@ attribute name="commentClass" type="java.lang.Class" required="true" %>
<c-rt:set var="sessionUser" value="<%= org.internna.iwebmvc.security.UserManager.SESSION_USER %>" />
<c-rt:set var="trackerUser" value="<%= org.internna.iwebjtracker.spring.mvc.IWebJTrackerModelDecoratorInterceptor.TRACKER_USER %>" />
<input id="commentParentIssue" name="commentParentIssue" type="hidden" />
<input id="commentParentIssueAlias" name="commentParentIssue" type="hidden" />
<input id="commentParentComment" name="commentParentComment" type="hidden" />
<div id="newCommentTextarea" class="border_${sessionScope[sessionUser].theme}" height="225" dojoType="dijit.Editor" style="height:225px;width:540px;"></div>
<div style="text-align:right;padding-top:5px">
    <span id="commentValidationWarningContainer" class="validationWarning"></span>
    <span id="issueCommentLoadingContainer" style="display:none"><img src='<c:url value="resource.iwebmvc?file=images/loading.gif" />' alt='' /></span>
    <iwebmvc:button buttonId="newCommentButton" label="ui.issue.actions.user.comment.save" buttonIcon="/resource.iwebmvc?file=/images/common/comment_${sessionScope[sessionUser].theme}.png">
        commentIssue("${iwebmvc:inferDWRConvertedJavascriptClass(issueClass)}", "${iwebmvc:inferDWRConvertedJavascriptClass(commentClass)}", byId("commentParentIssue").value, byId("commentParentComment").value, dijit.byId("newCommentTextarea").getValue(), byId("commentParentIssueAlias").value, "<iwebmvc:message argMessage="ui.issue.main.tabs.comments" />", "${requestScope[trackerUser].gravatar}", "${requestScope[trackerUser].name}", "<iwebmvc:message argMessage="ui.issue.comment.commented" />");
    </iwebmvc:button>
</div>